# made by Kamil Cukrowski <kamil@dyzio.pl>
# licensed under Beerware License.

include_files=common.h
lib_files=libcommon.so
INSTALL_DIR=/usr/local/

CFLAGS=-Wall -O2

All: libcommon.so


common.o: common.c common.h
	gcc $(CFLAGS) -fPIC -c common.c -o common.o

libcommon.so: common.o
	gcc $(CFLAGS) -shared -o libcommon.so common.o

install:
	install $(lib_files) $(INSTALL_DIR)/lib	
	install $(include_files) $(INSTALL_DIR)/include

uninstall:
	cd $(INSTALL_DIR)/lib && rm -f $(lib_files)
	cd $(INSTALL_DIR)/include && rm -f $(include_files) 

clean:
	rm *.o || true

dist-clean: distclean 
distclean: clean
	rm *.o $(lib_files) || true

